﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace TheSpirit
{
    class StoryManager : GameScreen
    {
        List<StoryScreen> storyScreen;
        int currentNum;
        int endNum;

        public StoryManager(int startNum, int endNum)
        {
            currentNum = startNum-1;
            this.endNum = endNum-1;

            storyScreen = new List<StoryScreen>();
            storyScreen.Add(new Story01());
        }

        public override void LoadContent()
        {
            ContentManager content = ScreenManager.Game.Content;

            for (int i = currentNum; i < endNum; i++ )
                storyScreen[i].LoadContent(content);
        }

        public override void HandleInput()
        {
            
            if (storyScreen[currentNum].Update())
                currentNum++;

            if (currentNum > endNum)
            {
                ExitScreen();
            }
        }

        public override void Draw(GameTime gameTime)
        {
            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin();
            storyScreen[currentNum].Draw(spriteBatch, gameTime);
            spriteBatch.End();
        }
    }
}
